package com.example.article.core.page.response;

import com.example.article.core.Constant;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;

@Data
@Builder
public class APIErrorResponse<R> {

    //泛型的用法
    public static <R> APIErrorResponse<R> makeSuccess(R meg) {

        return APIErrorResponse.<R>builder()
                .code(Constant.SUCCESS)
                .message(meg)
                .build();
    }
    private Integer code;
    private R message;

    @Tolerate //解决构造方法冲突问题
    public APIErrorResponse() {
    }
}
